Declaration emit should retain (instead of elide) unresolved computed names#58428
Conversation
|
This seems fine but I'm still not clear how this totally fixes the linked issue; shouldn't there be an error somewhere about this? |
There is... if the file is typechecked. I believe this isn't an isolated declarations error since it's the expectation that usually people won't write nonfunctional/conflicting computed names, and it'll just copy the input nodes to the output, which this PR adjusts our node builder and declaration emitter to do. |
|
Ah. Right, we don't include check errors in this output (unless we happen on them) |
jakebailey
left a comment
There was a problem hiding this comment.
But we probably need to warn about that somewhere... But it's not like transpileModule is much different. And a syntactic transpiler will probably just copy too.
Historically, if a
[name]: whateverdidn't resolve, it was elided in a declaration file, even when you wrote it explicitly in a type. This PR changes that behavior to instead copy the name into the output even when it doesn't resolve. Since the input has a checker error in this case, our declaration output here is flexible, and this makes us align with expectation underisolatedDeclarations.Fixes #58423